package com.gopay.checkorder.service.task;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import junit.framework.TestCase;

/**
 * 对单任务测试
 * 
 * @CheckOrderTask.java
 * @author yaobo
 * @2013-11-13 下午03:42:51 www.gopay.com.cn Inc.All rights reserved.
 */
public class CheckOrderTask extends TestCase {
    private Task checkOrderTask1;
    private Task checkOrderTask2;
    private Task checkOrderTask3;
    private Task checkOrderTask4;
    private Task checkOrderTask5;
    private Task checkOrderTask6;
    private Task checkOrderTask7;

    public void setUp() {
        ApplicationContext context = new ClassPathXmlApplicationContext("spring-config.xml");

        checkOrderTask1 = (Task) context.getBean("checkOrderTask-1");
        checkOrderTask2 = (Task) context.getBean("checkOrderTask-2");
        checkOrderTask3 = (Task) context.getBean("checkOrderTask-3");
        checkOrderTask4 = (Task) context.getBean("checkOrderTask-4");
        checkOrderTask5 = (Task) context.getBean("checkOrderTask-5");
        checkOrderTask6 = (Task) context.getBean("checkOrderTask-6");
        checkOrderTask7 = (Task) context.getBean("checkOrderTask-7");
    }

    /**
     * 测试：对单Task
     */
    public void testDoTask() {
        checkOrderTask1.doTask();
        checkOrderTask2.doTask();
        checkOrderTask3.doTask();
        checkOrderTask4.doTask();
        checkOrderTask5.doTask();
        checkOrderTask6.doTask();
        checkOrderTask7.doTask();
    }
}
